package com.wxg.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.wxg.common.core.dao.mysql.global.Dict;
import com.wxg.common.feign.remote.DictRemote;
import com.wxg.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by void on 2019/6/12.
 */
@RestController
public class UserController {

    @Autowired
    private DictRemote dictRemote;
    @Autowired
    private UserService userService;

    @GetMapping("/test")
    public String test(){
        Dict dict = dictRemote.query("test2");
        return JSON.toJSONString(dict);
    }

    @GetMapping("/test3")
    public String test3(){
        return "3333";
    }

    @GetMapping("/tran")
    public String testTran(){
        userService.tranTest();
        return "执行结束";
    }

    @GetMapping("/booleanTest1")
    public void booleanTest1(){
        System.out.println(dictRemote.booleanTest1());
        JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(dictRemote.booleanTest1()));
    }

    @GetMapping("/booleanTest2")
    public void booleanTest2(){
        System.out.println(dictRemote.booleanTest2());
    }
}
